import com.mihu.www.Boss;
import com.mihu.www.Coder;
import com.mihu.www.HelloWorld;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class BootStrap2 {
  public static void main(String[] args){
    ApplicationContext context = new AnnotationConfigApplicationContext(AppConfig2.class);
    HelloWorld helloWorld = (HelloWorld) context.getBean("helloWorld");
    helloWorld.say();
    Coder goodCoder = (Coder) context.getBean("goodCoder");
    Coder goodCoder2 = (Coder) context.getBean("goodCoder");
    System.out.println(goodCoder == goodCoder2);
    Boss boss = (Boss) context.getBean("boss");
    boss.financing();
  }
}
